import payRefundApi from '@/api/declaration/pay/payRefundApi'
import httpRequest from '@/config/axios/httpRequest'
import { PayRefundExportReqModel, RefundModel, RefundPageReqModel } from '@/models/pay/RefundModel'

// 查询列表退款订单
export const getRefundPage = (params: RefundPageReqModel) => {
  return httpRequest.get(payRefundApi.GetRefundPage, { params })
}

// 查询详情退款订单
export const getRefund = (id: number) => {
  return httpRequest.get(payRefundApi.GetRefund, { params: { id } })
}

// 新增退款订单
export const createRefund = (data: RefundModel) => {
  return httpRequest.post(payRefundApi.CreateRefund, data)
}

// 修改退款订单
export const updateRefund = (data: RefundModel) => {
  return httpRequest.put(payRefundApi.UpdateRefund, data)
}

// 删除退款订单
export const deleteRefund = (id: number) => {
  return httpRequest.delete(payRefundApi.DeleteRefund, { params: { id } })
}

// 导出退款订单
export const exportRefund = (params: PayRefundExportReqModel) => {
  return httpRequest.download(payRefundApi.ExportRefund, { params })
}
